package com.gitee.wsl.common.struct

import com.gitee.wsl.common.struct.delaunay.Delaunator
import com.gitee.wsl.ext.base.currentTimeMillis
import kotlin.random.Random
import kotlin.test.Test


class DelaunayTest {

    @Test
    fun bench() {

        val points = (1..10_000).map { arrayOf(1000 * Random.nextDouble() , 1000 *Random.nextDouble()) }.toTypedArray()

        val time = currentTimeMillis
        (1..50).forEach { _ ->
            Delaunator(points)
        }
        val meanTime = (currentTimeMillis - time) / 50.0
        val ops = 1000.0 / meanTime
        println("${ops.toInt()} ops/sec")

    }


}
